import com.sun.xml.internal.ws.addressing.WsaActionUtil;

class OuterClass{
    public int a1=1;
    private int a2=2;
    public static int a3=3;
    class InnerClass{
        public int a4=4;
       private int a5=5;
       //实例内部类不能有static修饰的成员变量，因为实例内部类是依赖外部类对象的，
       // 而static修饰的成员变量不依赖对象
        //除非使用final修饰后
       //public static int a6=6;
        public static final int a6=6;
        public int a1=11111;
        public void fun(){
            //实例内部类可以直接访问外部类的成员变量
            System.out.println(a1);
            System.out.println(a2);
            System.out.println(a3);
            System.out.println(a4);
            System.out.println(a5);
            System.out.println(a6);
            System.out.println("---------------------");
            //访问外部类和内部类同名的外部类成员变量
            OuterClass outerClass=new OuterClass();
            System.out.println(outerClass.a1);
            System.out.println(OuterClass.this.a1);
        }
    }
}
public class Test {
    public static void main(String[] args) {
        OuterClass outerClass=new OuterClass();
        OuterClass.InnerClass innerClass=outerClass.new InnerClass();
        innerClass.fun();
    }
}
